package com.wuxiaoqin.admin.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wuxiaoqin.admin.entity.Users;
import com.wuxiaoqin.admin.service.IUsersService;
import com.wuxiaoqin.uitls.respObj.RespBean;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author jobob
 * @since 2021-11-10
 */
@RestController
@RequestMapping("/users")
public class UsersController {

    @Autowired
    private IUsersService usersService;

    @ApiOperation("查看会员个数")
    @GetMapping("/selectUserCount")
    public RespBean selectUserCount()  {
        return usersService.selectUserCount();
    }

    @ApiOperation("查看会员个数")
    @GetMapping("/selectUserPage")
    public Page<Users> selectUserPage(@RequestParam("page") Integer page,
                                      @RequestParam("size") Integer size)  {
        return usersService.selectUserPage(page,size);
    }
    @ApiOperation("删除会员")
    @GetMapping("/deleteUser")
    public RespBean deleteUser(@RequestParam("userId") Integer userId)  {
        return usersService.deleteUser(userId);
    }

}
